<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/3/6
  Time: 16:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>--%>
<%@include file="../../../base.jsp" %>

<div class="container-fluid">
    <div class="modal-header">
        <h1 class="text-primary">
            ${growth.name}
            <c:if test="${growth.status == 0}">
                <strong style="color: black">[未发布]</strong>
            </c:if>
            <c:if test="${growth.status == 50}">
                <strong style="color: green">[已发布]</strong>
            </c:if>
            <c:if test="${growth.status == 99}">
                <strong style="color: red">[已废除]</strong>
            </c:if>
            <button type="button" class="btn btn-danger " onclick="growth.goEditPage('${growth.growthId}')">
                修改
            </button>
        </h1>
        <div class="  text-left">
            <form class="form-horizontal">
                <div class="form-group">
                    <label class="col-sm-1 control-label">描述</label>
                    <div class="col-sm-8">
                        <p class="form-control-static">${growth.descr}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">排序号</label>
                    <div class="col-sm-8">
                        <p class="form-control-static">${growth.rank}</p>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <br>
    <div>
        <h4 class="text-primary">卡片/试卷列表
            <button type="button" class="btn btn-primary" onclick="paper.editPaper()">
                添加试卷
            </button>
        </h4>
        <table class="table table-hover">
            <thead>
            <tr>
                <th>试卷排序号</th>
                <th>测试说明（描述）</th>
                <th>tips</th>
                <th>task</th>
                <th>卡片名称</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${growth.paperList}" var="paper" varStatus="vs">
                <tr class="
                <c:if test="${paper.status == 50}">
                    success
                </c:if>
                <c:if test="${paper.status == 99}">
                    danger
                </c:if>
                ">
                    <th scope="row">${paper.rank}</th>
                    <td>
                        <c:if test="${paper.status == 0}">
                            <strong style="color: black">[未发布]</strong>
                        </c:if>
                        <c:if test="${paper.status == 50}">
                            <strong style="color: green">[已发布]</strong>
                        </c:if>
                        <c:if test="${paper.status == 99}">
                            <strong style="color: red">[已废除]</strong>
                        </c:if>
                            ${paper.descr}
                    </td>
                    <td>${paper.tips}</td>
                    <td>
                        <c:if test="${ paper.paperTask == null}">
                            <button type="button" class="btn btn-primary btn-sm"
                                    onclick="paper.editTaskPage(null,'${paper.paperId}')">
                                添加task
                            </button>
                            无task
                        </c:if>

                        <c:if test="${ paper.paperTask != null}">

                            <button type="button" class="btn btn-primary btn-sm"
                                    onclick="paper.editTaskPage('${paper.paperTask.taskId}','${paper.paperId}')">
                                修改task
                            </button>
                            <c:if test="${paper.paperTask.status == 0}">
                                <strong style="color: black">[未发布]</strong>
                            </c:if>
                            <c:if test="${paper.paperTask.status == 50}">
                                <strong style="color: green">[已发布]</strong>
                            </c:if>
                            <c:if test="${paper.paperTask.status == 99}">
                                <strong style="color: red">[已废除]</strong>
                            </c:if>

                            ${paper.paperTask.descr}
                        </c:if>

                    </td>


                    <td>
                        <c:if test="${empty paper.paperCardId}">
                            <button type="button" class="btn btn-primary btn-sm"
                                    onclick="paper.addPaperCardPage('${paper.paperId}')">
                                添加卡片
                            </button>
                            无卡片
                        </c:if>
                        <c:if test="${!empty paper.paperCardId}">
                            <button type="button" class="btn btn-primary btn-sm"
                                    onclick="paper.goPaperCardPage('${paper.paperCardId}')">
                                查看卡片
                            </button>

                            <c:if test="${paper.paperCard.status == 0}">
                                <strong style="color: black">[未发布]</strong>
                            </c:if>
                            <c:if test="${paper.paperCard.status == 50}">
                                <strong style="color: green">[已发布]</strong>
                            </c:if>
                            <c:if test="${paper.paperCard.status == 99}">
                                <strong style="color: red">[已废除]</strong>
                            </c:if>

                            ${paper.paperCard.name}
                        </c:if>


                    </td>
                    <td>


                        <button type="button" class="btn btn-danger btn-sm"
                                onclick="growth.goPaperPage('${paper.paperId}')">
                            查看详情
                        </button>


                    </td>


                </tr>
            </c:forEach>

            </tbody>
        </table>
    </div>
</div>
<script src="${basePath}js/paper_js/paper.js"></script>